<!DOCTYPE html>
<html lang="zh-Hans">
  <head>
    
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>


<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<meta name="theme-color" content="#f8f5ec" />
<meta name="msapplication-navbutton-color" content="#f8f5ec">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="#f8f5ec">



  <meta name="description" content="sublime的一些个人使用心得"/>




  <meta name="keywords" content="技术, 工具, 杂鱼君的博客" />










  <link rel="alternate" href="/atom.xml" title="杂鱼君的博客">




  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=2.6.0" />



<link rel="canonical" href="http://notes.wen.moe/post/sublime-plugin-introduce.html"/>


<link rel="stylesheet" type="text/css" href="/css/style.css?v=2.6.0" />



  <link rel="stylesheet" type="text/css" href="/lib/fancybox/jquery.fancybox.css" />




  



  <script id="baidu_push">
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>









    <title> sublime的一些个人使用心得 - 杂鱼君的博客 </title>
  </head>

  <body><div id="mobile-navbar" class="mobile-navbar">
  <div class="mobile-header-logo">
    <a href="/." class="logo">杂鱼君的博客</a>
  </div>
  <div class="mobile-navbar-icon">
    <span></span>
    <span></span>
    <span></span>
  </div>
</div>

<nav id="mobile-menu" class="mobile-menu slideout-menu">
  <ul class="mobile-menu-list">
    
      <a href="/">
        <li class="mobile-menu-item">
          
          
            Home
          
        </li>
      </a>
    
      <a href="/archives/">
        <li class="mobile-menu-item">
          
          
            Archives
          
        </li>
      </a>
    
      <a href="/tags">
        <li class="mobile-menu-item">
          
          
            Tags
          
        </li>
      </a>
    
      <a href="/about">
        <li class="mobile-menu-item">
          
          
            About
          
        </li>
      </a>
    
  </ul>
</nav>

    <div class="container" id="mobile-panel">
      <header id="header" class="header"><div class="logo-wrapper">
  <a href="/." class="logo">杂鱼君的博客</a>
</div>

<nav class="site-navbar">
  
    <ul id="menu" class="menu">
      
        <li class="menu-item">
          <a class="menu-item-link" href="/">
            
            
              Home
            
          </a>
        </li>
      
        <li class="menu-item">
          <a class="menu-item-link" href="/archives/">
            
            
              Archives
            
          </a>
        </li>
      
        <li class="menu-item">
          <a class="menu-item-link" href="/tags">
            
            
              Tags
            
          </a>
        </li>
      
        <li class="menu-item">
          <a class="menu-item-link" href="/about">
            
            
              About
            
          </a>
        </li>
      
    </ul>
  
</nav>

      </header>

      <main id="main" class="main">
        <div class="content-wrapper">
          <div id="content" class="content">
            
  
  <article class="post">
    <header class="post-header">
      <h1 class="post-title">
        
          sublime的一些个人使用心得
        
      </h1>

      <div class="post-meta">
        <span class="post-time">
          2014-01-17
        </span>
        
          <div class="post-category">
            
              <a href="/categories/技术/">技术</a>
            
          </div>
        
        
      </div>
    </header>

    
    

    <div class="post-content">
      
        <p>SubLime Text(ST)是一个很适合程序猿使用的跨平台文本编辑器,有很多强大的内置功能以及丰富的第三方插件.我在第一次接触他的时候就被彻底征服.又大又笨的IDE还是见鬼去吧.<br>下载安装ST可以直接去<a href="http://www.sublimetext.com/" target="_blank" rel="external">官网</a>,有2和3两个版本,ST3目前是beta版,不过日常使用依然是挺稳定的,看个人喜好吧,我用的是2.</p>
<a id="more"></a>
<p>##安装Package Control</p>
<p>Package Control是ST的插件管理器,可以直接通过它方便的在线安装各种好用的插件,最简单的方法是通过以下方法安装:</p>
<p>####SubLime Text2</p>
<blockquote>
<p>import urllib2,os,hashlib; h = ‘eb2297e1a458f27d836c04bb0cbaf282’ + ‘d0e7a3098092775ccb37ca9d6b2e4b7d’; pf = ‘Package Control.sublime-package’; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler()) ); by = urllib2.urlopen( ‘<a href="http://packagecontrol.io/" target="_blank" rel="external">http://packagecontrol.io/</a>‘ + pf.replace(‘ ‘, ‘%20’)).read(); dh = hashlib.sha256(by).hexdigest(); open( os.path.join( ipp, pf), ‘wb’ ).write(by) if dh == h else None; print(‘Error validating download (got %s instead of %s), please try manual install’ % (dh, h) if dh != h else ‘Please restart Sublime Text to finish installation’)</p>
</blockquote>
<p>####SubLime Text3</p>
<blockquote>
<p>import urllib.request,os,hashlib; h = ‘eb2297e1a458f27d836c04bb0cbaf282’ + ‘d0e7a3098092775ccb37ca9d6b2e4b7d’; pf = ‘Package Control.sublime-package’; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( ‘<a href="http://packagecontrol.io/" target="_blank" rel="external">http://packagecontrol.io/</a>‘ + pf.replace(‘ ‘, ‘%20’)).read(); dh = hashlib.sha256(by).hexdigest(); print(‘Error validating download (got %s instead of %s), please try manual install’ % (dh, h)) if dh != h else open(os.path.join( ipp, pf), ‘wb’ ).write(by)</p>
</blockquote>
<p>安装完毕以后就可以通过command+shift+p 执行Package Control 的命令了.</p>
<p>##常用的插件介绍</p>
<p>####SublimeCodeIntel<br>非常强大的代码提示插件,支持大多数常见的编程语言.安装好了即可使用.</p>
<p>####CodeFormatter<br>依然非常强大的代码格式化插件,可以对PHP,HTML,JS,JSON,CSS,Python2 的代码格式化.使用方法是通过默认的快捷键Command+Alt+F或者命令行调用CodeFormatter执行.</p>
<p>####ConvertToUTF8<br>这是一款将GBK,ANSI,BIG5等编码格式的文件转换成UTF8编码格式的插件,安装后自动生效.</p>
<p>####Emmet<br>通过一些特定的指令快速编写html代码的插件.比如敲 <code>div.container&gt;ul#list&gt;li.item*3</code>出现如下html内容:</p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></td><td class="code"><pre><div class="line"><span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">"container"</span>&gt;</span></div><div class="line">    <span class="tag">&lt;<span class="name">ul</span> <span class="attr">id</span>=<span class="string">"list"</span>&gt;</span></div><div class="line">        <span class="tag">&lt;<span class="name">li</span> <span class="attr">class</span>=<span class="string">"item"</span>&gt;</span><span class="tag">&lt;/<span class="name">li</span>&gt;</span></div><div class="line">        <span class="tag">&lt;<span class="name">li</span> <span class="attr">class</span>=<span class="string">"item"</span>&gt;</span><span class="tag">&lt;/<span class="name">li</span>&gt;</span></div><div class="line">        <span class="tag">&lt;<span class="name">li</span> <span class="attr">class</span>=<span class="string">"item"</span>&gt;</span><span class="tag">&lt;/<span class="name">li</span>&gt;</span></div><div class="line">    <span class="tag">&lt;/<span class="name">ul</span>&gt;</span></div><div class="line"><span class="tag">&lt;/<span class="name">div</span>&gt;</span></div></pre></td></tr></table></figure>
<p>除此之外还很多进阶功能,但是需要一段时间的学习.</p>
<p>####Bracket Highlighter<br>高亮显示匹配的括号、引号和标签对.虽然ST本身就有匹配的功能,但是Bracket Highlighter自定义选项更加丰富,尤其是在编写html代码的时候非常有用.</p>
<p>####AutoFileName<br>自动补全文件名.</p>
<p>####JavaScript Completions<br>JS &amp; JQuery的代码提示插件,SublimeCodeIntel无法提示jQuery的代码补全,这个插件可以帮助你.</p>
<p>####SublimeLinter<br>一个支持lint语法的插件，可以高亮linter认为有错误的代码行.建议在设置里面将<code>sublimelinter_popup_errors_on_save</code>改成<code>true</code>,让插件只在保存的时候提示错误.</p>
<p>####Clipboard History<br>粘贴板历史记录，可以方便的查看和调用粘贴板的使用记录.</p>
<p>####Goto-CSS-Declaration<br>在html中跳转到某个某个class/id 的定义处.注意相关的css文件必须同时打开.</p>
<p>####Git<br>大家都知道这个是干嘛的.</p>
<p>##不得不记住的快捷键操作</p>
<p>####Command+Shift+P<br>打开ST命令行.所有软件功能,包括插件的功能,都能在这里调用.而且支持模糊匹配.</p>
<p>####Command+P<br>通过文件名查找/打开文件.搜索的范围是ST所有打开的文件和文件夹即左侧side Bar 里面的所有内容.</p>
<p>####Command+R<br>或者Command+P再输入”@”(不带引号).在当前文件里查找函数/方法. </p>
<p>####Command+Shift+F<br>在ST所有打开的文件和文件夹(即左侧side Bar 里面的所有内容)/指定的文件夹中查找对应内容.</p>
<p>####Command+G<br>或者Command+P再输入”:”(不带引号).跳转到该文件的某一行</p>
<p>####Command+:<br>或者Command+P再输入”#”(不带引号).查看该文件所有已使用的关键字/变量名/函数/字符串 等.</p>
<p>####Alt+Shift+1/2/3/4/5<br>分屏显示.</p>
<p>####Command+K+U/L<br>将选中的内容转换为大/小写</p>
<p>####Command+J<br>将多行代码合并为一行</p>
<p>以上都是我自己总结的一些常用功能.不得不说，Sublime Text 是一款很优秀的编辑器,ui好看,各种细节令人惊奇,功能拓展强大,确实不愧他’sublime’的名头,值得各位程序猿去尝试.</p>

      
    </div>

    
      
      

  <div class="post-copyright">
    <p class="copyright-item">
      <span>Author: </span>
      <a href="http://notes.wen.moe">zakokun</a>
    </p>
    <p class="copyright-item">
      <span>Link: </span>
      <a href="http://notes.wen.moe/post/sublime-plugin-introduce.html">http://notes.wen.moe/post/sublime-plugin-introduce.html</a>
    </p>
    <p class="copyright-item">
      <span>License: </span>
      
      <a rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/" target="_blank">知识共享署名-非商业性使用 4.0 国际许可协议</a>
    </p>
  </div>



      
      
    

    
      <footer class="post-footer">
        
          <div class="post-tags">
            
              <a href="/tags/技术/">技术</a>
            
              <a href="/tags/工具/">工具</a>
            
          </div>
        
        
        
  <nav class="post-nav">
    
      <a class="prev" href="/post/how-to-export-csv-file-by-php.html">
        <i class="iconfont icon-left"></i>
        <span class="prev-text nav-default">php导出csv文件的一些操作</span>
        <span class="prev-text nav-mobile">Prev</span>
      </a>
    
    
      <a class="next" href="/post/how-to-print-all-five-letters-string-by-php.html">
        <span class="next-text nav-default">如何用PHP输出26个英文字母组成的所有5位字符串?</span>
        <span class="prev-text nav-mobile">Next</span>
        <i class="iconfont icon-right"></i>
      </a>
    
  </nav>

      </footer>
    

  </article>


          </div>
          
  <div class="comments" id="comments">
    
      <div id="disqus_thread">
        <noscript>
          Please enable JavaScript to view the
          <a href="//disqus.com/?ref_noscript">comments powered by Disqus.</a>
        </noscript>
      </div>
    
  </div>


        </div>
      </main>

      <footer id="footer" class="footer">

  <div class="social-links">
    
      
        
          <a href="mailto:me@wen.moe" class="iconfont icon-email" title="email"></a>
        
      
    
      
    
      
    
      
    
      
    
      
    
      
    
      
    
      
    
      
    
      
    
      
    
      
        
          <a href="https://www.instagram.com/zakokun" class="iconfont icon-instagram" title="instagram"></a>
        
      
    
    
    
  </div>


<div class="copyright">
  <span class="power-by">
    Powered by <a class="hexo-link" href="https://hexo.io/">Hexo</a>
  </span>
  <span class="division">|</span>
  <span class="theme-info">
    Theme -
    <a class="theme-link" href="https://github.com/ahonn/hexo-theme-even">Even</a>
  </span>
  <span class="division">|</span>
  <span class="theme-info">
    Hosted by <a class="theme-link" href="https://pages.coding.me" style="font-weight: bold">Coding Pages</a>
  </span>

  <span class="copyright-year">
    
    &copy;
    
      2014 -
    
    2017

    <span class="heart">
      <i class="iconfont icon-heart"></i>
    </span>
    <span class="author">zakokun</span>
  </span>
</div>

      </footer>

      <div class="back-to-top" id="back-to-top">
        <i class="iconfont icon-up"></i>
      </div>
    </div>

    
  
  <script type="text/javascript">
    var disqus_config = function () {
        this.page.url = 'http://notes.wen.moe/post/sublime-plugin-introduce.html';
        this.page.identifier = 'post/sublime-plugin-introduce.html';
        this.page.title = 'sublime的一些个人使用心得';
    };
    (function() {
    var d = document, s = d.createElement('script');

    s.src = '//evanszhang.disqus.com/embed.js';

    s.setAttribute('data-timestamp', +new Date());
    (d.head || d.body).appendChild(s);
    })();  
  </script>




    
  





  
    <script type="text/javascript" src="/lib/jquery/jquery-3.1.1.min.js"></script>
  

  
    <script type="text/javascript" src="/lib/slideout/slideout.js"></script>
  

  
    <script type="text/javascript" src="/lib/fancybox/jquery.fancybox.pack.js"></script>
  


    <script type="text/javascript" src="/js/src/even.js?v=2.6.0"></script>
<script type="text/javascript" src="/js/src/bootstrap.js?v=2.6.0"></script>

  </body>
</html>
